home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
005
/
miscstat.arc
/
POISDIST.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-04-25
|
713b
|
26 lines
1 'POISson DISTribution
2 KEY OFF:SCREEN 0,1,0:WIDTH 40:COLOR 15,1,9:CLS
10 PRINT "POISSON DISTRIBUTION"
20 PRINT
30 PRINT "(TO END PROGRAM ENTER 0)"
40 PRINT "CALCULATED FREQUENCY";
50 INPUT L:IF L<0 THEN 50
60 IF L = 0 THEN 180
70 PRINT "TEST FREQUENCY";
80 INPUT X:IF X<0 THEN 80
90 A = 1
100 FOR I = 1 TO X
110 A = A * I
120 NEXT I
130 A = LOG (A)
140 A = EXP ( - L + X * LOG (L) - A)
150 PRINT:PRINT "PROBABILITY OF"X"OCCURRENCES":PRINT"IS";A
160 PRINT
170 GOTO 40
180 PRINT:LOCATE 24,1:PRINT"PRESS <SPACE> TO RUN AGAIN";
190 LOCATE 25,1:PRINT"PRESS <ESC> TO EXIT";
200 K$=INKEY$:IF K$="" THEN 200
210 IF K$=" " THEN RUN
220 IF K$<>CHR$(27) THEN 200
10000 RUN"MENU